<%@ page language="java" import="java.util.*" contentType="text/html;charset=utf-8" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript" src="<%=basePath %>js/jquery.js"></script>
<script type="text/javascript" src="<%=basePath %>js/jquery.json-2.4.min.js"></script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>">
<title>考试系统</title>
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}
.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}
.STYLE6 {color: #000000; font-size: 12; }
.STYLE10 {color: #000000; font-size: 12px; }
.STYLE19 {
	color: #344b50;
	font-size: 12px;
}
.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}
.STYLE22 {
	font-size: 12px;
	color: #295568;
}
-->
</style>
	<script  type="text/javascript">
	
	function selectclazz(){
		var clazzid = document.getElementById("clazzid");
		window.location.href="<%=request.getContextPath() %>/Clazz/Login!selectPaperByClazz.action?info="+clazzid.value;
	}
	
	
	
	</script>
</head>
<body>
<select id="clazzid" onchange="selectclazz()">
<s:iterator value="#session.classlist" var="class">
<option value='<s:property value="#class.id" />'  <c:if test="${id == clazzid}">selected="selected"</c:if>   ><s:property value="#class.classname" /></option>
</s:iterator>
</select>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="24" bgcolor="#353c44"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="6%" height="19" valign="bottom"><div align="center"><img src="images/tb.gif" width="14" height="14" /></div></td>
                <td width="94%" valign="bottom"><span class="STYLE1"> 班级考试列表</span></td>
              </tr>
            </table></td>
            <td><div align="right"></div></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  
  
  
  <tr>
    <td ><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce" id = "datatable">
      <tr >
        <td width="5%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">考试编号</span></div></td>
        <td width="15%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">考试名称</span></div></td>
        <td width="5%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">考试类型</span></div></td>
        <td width="14%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">开始时间</span></div></td>
        <td width="14%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">结束时间</span></div></td>
        <td width="5%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">考试状态</span></div></td>
        <td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">基本操作</span></div></td>
        
      </tr>
      
      <s:iterator value="#session.paperlist" var="papers">
	  <tr>	  
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><span class="STYLE10"><s:property value="#papers.id"/> </span></div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><span class="STYLE10"><s:property value="#papers.papername"/> </span></div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><span class="STYLE10">
        <s:if test="#papers.isjava==0">JAVA</s:if>                                       <s:date name="user.brithday" format="yyyy-MM-dd" />
        <s:else>C++</s:else>
       
        </span></div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><span class="STYLE10"><s:date name="#papers.begintime" format="yyyy-MM-dd HH:mm:ss" /> </span></div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><span class="STYLE10"><s:date name="#papers.endtime" format="yyyy-MM-dd HH:mm:ss" /> </span></div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><span class="STYLE10"><s:property value="#papers.status"/> </span></div></td>		 	 
		<td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE21">
		  
		  <s:if test="#papers.status == 'running'">	   			
       			<a href="<%=request.getContextPath()%>/Exam/ExamAction!beginExam.action?id=<s:property value="#papers.id"/>">参加</a>    			
		  </s:if>
		  <s:else>无法操作</s:else>
		</span></div></td>
		
	  </tr>
	  </s:iterator>
      
      
      
    </table></td>
  </tr>
	</table>
	
	<div id ='wait'></div>
	
</body>
</html>
